PDF Split function allows users to divide one PDF Document to multiple files. It is much like that when we read a book, but we do not necessary to read them all, so we select the chapters that we need to read. When we do this, we actually unconsciously split the book into two or more books. PDF Split function enables people to split the information according to the category and provides great convenience to find the certain information in a short time.
Now, let us look at my blog. The different categories in the right column split the whole blog articles into multiple posts of various kinds, which is very convenient. That is why we split one PDF Document to multiple files.
This task needs a document of at least two pages. I use a PDF creation component Spire.PDF for .NET which contains a PDF Document of eight pages and can split PDF document with a fast speed.
Freely Download Spire.PDF
Now, let us look at my blog. The different categories in the right column split the whole blog articles into multiple posts of various kinds, which is very convenient. That is why we split one PDF Document to multiple files.
This task needs a document of at least two pages. I use a PDF creation component Spire.PDF for .NET which contains a PDF Document of eight pages and can split PDF document with a fast speed.
Freely Download Spire.PDF
Procedure:
Step1. Load the PDF Document “Sample3.pdf” from Spire.PDF in the system.
Step2. Split the PDF Document to multiple files. In the code, I split the eight pages’ PDF Document to eight PDF files.
Step3. Launch the project and see the eight PDF files.
Main Code:
Step1. Load the PDF Document “Sample3.pdf” from Spire.PDF in the system.
Step2. Split the PDF Document to multiple files. In the code, I split the eight pages’ PDF Document to eight PDF files.
Step3. Launch the project and see the eight PDF files.
Main Code:
C# Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Spire.Pdf;
namespace split_pdf
{
class Program
{
static void Main(string[] args)
{
//open pdf document
PdfDocument doc = new PdfDocument(@"C:\Program
Files\e-iceblue\Spire.Pdf\Demos\Data\Sample3.pdf");
//Split the PDF Document
String pattern = "SplitDocument-{0}.pdf"; doc.Split(pattern);
String lastPageFileName = String.Format(pattern, doc.Pages.Count - 1);
doc.Close();
//Launching the Pdf file.
System.Diagnostics.Process.Start(lastPageFileName);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Spire.Pdf;
namespace split_pdf
{
class Program
{
static void Main(string[] args)
{
//open pdf document
PdfDocument doc = new PdfDocument(@"C:\Program
Files\e-iceblue\Spire.Pdf\Demos\Data\Sample3.pdf");
//Split the PDF Document
String pattern = "SplitDocument-{0}.pdf"; doc.Split(pattern);
String lastPageFileName = String.Format(pattern, doc.Pages.Count - 1);
doc.Close();
//Launching the Pdf file.
System.Diagnostics.Process.Start(lastPageFileName);
}
}
}
VB.NET Code:
Imports System;
Imports System.Collections.Generic;
Imports System.Linq;
Imports System.Text;
Imports Spire.Pdf;
Namespace split_pdf
Friend Class Program
Shared Sub Main(ByVal args() As String)
'open pdf document
Dim doc As New PdfDocument("C:\Program
Files\e-iceblue\Spire.Pdf\Demos\Data\Sample3.pdf")
‘Split the PDF Document
Dim pattern As String = "SplitDocument-{0}.pdf"doc.Split(pattern)
Dim lastPageFileName As String = String.Format(pattern, doc.Pages.Count - 1)
doc.Close()
'Launching the Pdf file.
Process.Start(lastPageFileName)
End Sub
End Class
End Namespace
Imports System;
Imports System.Collections.Generic;
Imports System.Linq;
Imports System.Text;
Imports Spire.Pdf;
Namespace split_pdf
Friend Class Program
Shared Sub Main(ByVal args() As String)
'open pdf document
Dim doc As New PdfDocument("C:\Program
Files\e-iceblue\Spire.Pdf\Demos\Data\Sample3.pdf")
‘Split the PDF Document
Dim pattern As String = "SplitDocument-{0}.pdf"doc.Split(pattern)
Dim lastPageFileName As String = String.Format(pattern, doc.Pages.Count - 1)
doc.Close()
'Launching the Pdf file.
Process.Start(lastPageFileName)
End Sub
End Class
End Namespace
We can choose Document 5 to preview:
Obviously, using Spire.PDF for .NET, we can easily split one PDF Document to multiple PDF files. Besides, Spire.PDF has many other rich functions, such as embedding fonts, draw shapes, load images to PDF Document, import data, Auto Page Breaks for large tables and so on. If you encounter problems during using Spire.PDF, Please leave your questions in the
below PDF forum.
PDF Forum
below PDF forum.
PDF Forum